package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.IWemdiaClient;
import com.heima.model.admin.dto.NewsAuthDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/news")
public class AdNewsController {

    @Autowired
    private IWemdiaClient iWemdiaClient;

    @PostMapping("/list_vo")
    public ResponseResult findAllScan(@RequestBody NewsAuthDto dto){
        return iWemdiaClient.findAllScan(dto);
    }

    @GetMapping("/one_vo/{id}")
    public ResponseResult findById(@PathVariable("id") Integer id){
        return  iWemdiaClient.findById(id);
    }

    @PostMapping("/auth_fail")
    public ResponseResult updateFail(@RequestBody NewsAuthDto dto){
        return iWemdiaClient.updateFail(dto);
    }

    @PostMapping("/auth_pass")
    public ResponseResult updatePass(@RequestBody NewsAuthDto dto){
        return iWemdiaClient.updatePass(dto);
    }
}
